import request from '../utils/request.js'

export default {
    //请求用户基本信息
    SubmitUser(){
        return request({
            method: 'get',
            url: '/userservice/userInfo/query',
        })
    },
    //账号密码登录
    SubmitLoginByAccount(user){
        return request({
            method: 'post',
            url: `/userservice/userManagement/login`,
            data:user
        })
    },
    //获取验证码
    SubmitPhoneCode(phone_number){
        return request({
            method:'get',
            url:`/userservice/userManagement/sms?phone_number=${phone_number}`
        })
    },
    //手机号登录
    SubmitLoginByPhone(phone_number,code){
        return request({
            method: 'get',
            url: `/userservice/userManagement/login?phone_number=${phone_number}&code=${code}`,
        })
    },
    //检查注册信息是否重复
    SubmitRegisterRepeat(key,value) {
        return request({
            method: 'get',
            url: `/userservice/userManagement/checkNoRepeat?key=${key}&value=${value}`,
        })
    },
    //发送注册请求
    SubmitRegister(user) {
        return request({
            method: 'post',
            url: '/userservice/userManagement/register',
            data: user
        })
    },
    //修改个人信息
    SubmitUpdateUser(data){
        return request({
            method: 'put',
            url: `/userservice/personalCenter/updateUserInfo`,
            data:data
        })
    },
    //根据用户基本信息查询用户信息
    SubmitUserVOByUser(user){
        return request({
            method: 'post',
            url: `/userservice/userInfo/queryUserInfo`,
            data:user
        })
    }
}